<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>easyExcel测试</title>
    <link rel="stylesheet" href="/static/css/element-ui/element-ui.css">
    <link rel="stylesheet" href="/static/css/public.css">
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/layer/layer.js"></script>
    <script src="/static/js/vue.min.js"></script>
    <script src="/static/js/element-ui.js"></script>
    <script src="/static/js/public.js"></script>
</head>
<body>
<div v-cloak id="app">
    <el-button type="primary" size="medium" @click="exportExcel">导出Excel</el-button>
</div>
<script>
    $(function () {
    });

    var data = {};

    var methods = {
        exportExcel: function () {
            var load = layer.load(2);
            ajax.post("/test/exportExcelPrepare", function (res) {
                window.location.href = '/test/exportExcel?key=' + res.data;
                setTimeout(function () {
                    layer.close(load)
                }, 500)
            })
        }
    };
    var vm = new Vue({data: data, methods: methods}).$mount("#app");
</script>
</body>
</html>
